﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WF1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        public static Dictionary<string, string> user = new Dictionary<string, string>();
        private void button1_Click(object sender, EventArgs e)
        {
            var uid = textBox1.Text.Trim();
            var pwd = textBox2.Text.Trim();

            var usr = user.Where(x => x.Key == uid && x.Value == pwd).Select(x => new { key = x.Key, value = x.Value }).FirstOrDefault();



            if (usr != null)
            {
                MessageBox.Show("登陆成功");
                Form2 form2 = new Form2();
                this.Hide();
                form2.Show();
            }
            else
            {
                MessageBox.Show("登陆失败");
                this.Close();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Form3 form3 = new Form3();
            form3.Show();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            user.Add("qwer", "135246");
        }
    }
}
